<?php

namespace app\common\service;


use app\traits\Result;

class BaseAdminService
{

    use Result;

    /**
     * @var array 验证场景标签
     */
    protected static $sceneLabel = [
        'add'  =>  '新增',
        'edit' =>  '更新',
    ];

    /**
     * @var array 验证场景返回信息
     */
    protected static function getSceneMessage($result,$scene){
        $msg = $result?'成功':'失败';
        $msg =  isset(self::$sceneLabel[$scene])?self::$sceneLabel[$scene].$msg:'操作'.$msg;
        return $result?self::success($msg):self::error($msg);
    }
}